<br />
<p style="color: red; font-weight: bold;font-size: 30px;margin-left:120px ;">KẾT QUẢ ĐĂNG KÝ LỊCH COI THI</p><br />
<br />

</p><br />        
<form action="" method="post">
<table border="1"  style="width:690px;" >
 <!-- begin caption -->
	<tr height="30">
        <th>Ngày thi</th>
        <th>Phòng <br />
thi</th>
        
        <th>Ca thi</th>
        <th>Thời gian <br />
đăng ký</th>
    <th>Hình thức<br />
 thi </th>
    <th>Số lượng <br />
thí sinh</th>
    <th>Ghi chú</th>  
    <tr>
    <!-- end caption -->
    <?php
            $sql="SELECT * FROM `ketquadangky` kq, `lichthi` lt where kq.`stt`=lt.`stt` AND `mssv`=".$_SESSION['iduser']." order by kq.`ngaydangky` desc";
            $sqlcount="SELECT count(*) FROM `ketquadangky` kq, `lichthi` lt where kq.`stt`=lt.`stt` AND `mssv`=".$_SESSION['iduser'];
             $sort=$_GET['sort'];
            $p=$_GET['page'];
            $rscount=mysql_query($sqlcount);
             $r=mysql_fetch_row($rscount);
             $p=max(0,round($p));
       
            if(!isset($_GET['page']))
    			{
    				$_GET['page'] = 1;
    			}
            $ipp=10;
            $noi=$r[0];
            
            $nop=ceil($noi/$ipp);
            $p=min($nop,$p);	
            $pos=($p-1)*$ipp;                                                 
           
            if($p>=1){
           
            $sql.=" LIMIT $pos,$ipp";
         
             }
             $rs=mysql_query($sql);
            while($r=mysql_fetch_assoc($rs)){
            $idphong=$r['idphong'];
            $idca=$r['idca'];
         ?>
         <tr>
        <td align="center"><?php echo convertDateVN($r['thoigian']); ?></td>
        <td align="center"><?php $sql2="select * from `phongthi` where `idphong`=".$idphong;
                        $rs2=mysql_query($sql2);
                        $r2=mysql_fetch_assoc($rs2);
         ?><?php echo $r2['tenphong'] ?></td>
         <td align="center"><?php echo $r['idca']; ?></td>
        
        <td align="center"><?php echo $r['ngaydangky'] ?></td> 
        <td align="center"><?php 
                foreach($array as $k=>$v){
                        if($k==$r['hinhthucthi']){
                            echo $v;
                        }
                    
                }
         ?></td> 
           <td align="center"><?php echo $r['sothisinh'] ?></td>
           <td align="center"><?php echo $r['ghichu'] ?></td>
            </tr>
        <?php }  ?>
       
</table><br /><br />
 <?php
		 
           
			echo '<div id="center2">';
			echo '<ul id="pagination-digg">';
			if($p > 1)
			{
				echo '<li class="previous"><a href="?mod=ketquadangky&page='.($p-1).'">Back</a></li>';
			}
			for($i=1;$i<$nop;$i++)
			{
				if($p == $i)
				{
					echo '<li class="active">'.$i.'</li>';
				}
				else
				{
					echo '<li><a href="?mod=ketquadangky&page='.$i.'">'.$i.'</a></li>';
				}
			}
			if($p < $nop)
			{
				echo '<li class="next"><a href="?mod=ketquadangky&sort=&page='.($p+1).'">next</a></li></ul></div>';
			}
			else
			{
				echo '<li class="next-off">next</li></ul></div>';
			}
		 ?>        


<br /><br /><br />
 <p><span style="color: red;">Lưu ý:</span>
            Mỗi ca thi tương ứng với giờ thi sau:
            
        </p>
        <?php $sql3="SELECT * FROM `cathi`";
                $rs3=mysql_query($sql3);
                while($r3=mysql_fetch_assoc($rs3)){
         ?>
         <p style="font-size: 15px;"><?php echo $r3['tenca']?> : <?php echo $r3['gio']; ?></p>
         <?php } ?>
       
</table>